package com.atguigu.exer2;

public class TestTriangle {
    public static void main(String[] args) {
        Triangle t1 = new Triangle();
        t1.a = 6;
        t1.b = 6;
        t1.c = 6;
        System.out.println("三边：" + t1.a +"，" + t1.b +"，" + t1.c );
        double p1 = (t1.a + t1.b + t1.c)/2;
        double a1 = Math.sqrt(p1 * (p1-t1.a) * (p1-t1.b)*(p1-t1.c));
        System.out.println("面积：" + a1);
        System.out.println("周长：" + (t1.a + t1.b  + t1.c));

        Triangle t2 = new Triangle(3,4,5);
        System.out.println("三边：" + t2.a +"，" + t2.b +"，" + t2.c );
        double p2 = (t2.a + t2.b + t2.c)/2;
        double a2 = Math.sqrt(p2 * (p2-t2.a) * (p2-t2.b)*(p2-t2.c));
        System.out.println("面积：" + a2);
        System.out.println("周长：" + (t2.a + t2.b  + t2.c));

        Triangle t3 = new Triangle(1,1,5);
        System.out.println("三边：" + t3.a +"，" + t3.b +"，" + t3.c );
        double p3 = (t3.a + t3.b + t3.c)/2;
        double a3 = Math.sqrt(p3 * (p3-t3.a) * (p3-t3.b)*(p3-t3.c));
        System.out.println("面积：" + a3);
        System.out.println("周长：" + (t3.a + t3.b  + t3.c));
    }
}
